package oa.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import oa.entity.Document;

public interface DocumentMapper {
	@Select("select document.*,employee.`name` creatorName from document join employee on document.creatorId=employee.id")
	List<Document> getAll();
	@Select("select document.*,employee.`name` creatorName from document join employee on document.creatorId=employee.id where parentId=#{parentId}")
	List<Document> getChild(@Param("parentId")int parentId);
	@Select("select document.*,employee.`name` creatorName from document join employee on document.creatorId=employee.id where id=#{id}")
	Document fetchDocumentById(@Param("id")int id);
	void addDocument(Document doc);
	void updateDocument(Document doc);
	void removeDocument(int id);
}
